<?php
session_start();
include 'interface.php';
include 'dbconnect.php';
$dbcnx = dbconnect();
$theme= $_POST["theme"];
$text = $_POST["text"]; 




$aut_id = $_SESSION['id'];
//$dt = new DateTime(;
//$datetime = $dt->format('Y-m-d H:i:s');
   $query = "INSERT INTO `newsdb`.`records` (`caption`, `theme`, `text`, `date`, `author_id`, `type`) 
			VALUES (\"$theme\", \"$theme\", \"$text\", NOW(), \"$aut_id\", \"1\")";
$t = mysql_query($query); 
if (!$t )
  {
   // die('Беда=( ' .mysql_error());
  }

echo "<html>";
echo "<title>";
  echo "Чатик - заявка отправлена";
echo "</title>";
echo "<body>";

    echo "<table width = \"100%\" bordercolor = \"green\"><!-- \"#5a009c\" -->";
        drawHeader();
    echo "<tr>";
        echo "<td></td>";
        echo "<td colspan = \"2\" rowspan = \"2\">";
        
        echo "Новость успешно отправлена!  ";
		echo "<a href = index.php?type=1> На главную </a>";
        echo "</td>";
        echo "</tr>";
    echo "</table>";   
echo "</body>";	
echo "</html>";
?>

